Skip to content

Make CI's REQ-PBT-002/004/008 checks check what they say - #24

Open
evertonfraga wants to merge 1 commit into
mainfrom
ci/enforce-labelled-checks
Open

evertonfraga wants to merge 1 commit into
mainfrom
ci/enforce-labelled-checks

Conversation

@evertonfraga

Copy link
Copy Markdown
Contributor

Summary

Three CI stages, and lake test, could pass without checking what they are labelled with. This makes each one actually run its check.

.github/workflows/ci.yml

  • REQ-PBT-008 (benchmark CSV): runs bench/bench.sh and validates the CSV it writes. Before, it validated the committed bench/results.csv from May, which could only fail if someone edited that file. The benchmarks take about 5 s; the old reason for skipping them (b6_erc20 taking 10+ minutes) no longer holds.
  • REQ-PBT-004 (SARIF): runs pytest with -rs, so skip reasons are printed.
  • REQ-PBT-002 (pipeline determinism): new step. Runs lake run pbt-determinism on its default fixture and on test/examples/b3_token.sol. The driver existed but CI never ran it.

Other files

  • Tools/Solidity/test/conftest.py: under CI, a skipped test fails the run. The 15 tests skip themselves when the binary or solc is missing, so before this the SARIF stage could pass with every test skipped.
  • lakefile.lean: declares StrataSolidityTest/Solidity/tests/*.sol as an input_dir of the test library. lake test now runs the tests again when a fixture changes; before, it replayed JsonOutputTest's cached result.
  • bench/results.csv: refreshed from the current binary. The committed rows were stale: b3_token had 9 obligations instead of 12, b5_escrow showed error instead of 9/9 passed, b6_erc20 had 14 instead of 11.
  • StrataSolidityTest/Solidity/run_pbt_determinism.sh: corrects stale comments (the wrapper no longer calls mktemp; the pipeline has no Python or Ion stage).
  • README.md: the CI step list matches ci.yml, including the z3 install and site build steps it left out.

Testing

  • bash bench/bench.sh: 6/6 ok, schema check passes.
  • lake run pbt-determinism, on the default fixture and on b3_token.sol: both pass, and the raw output is byte-equal.
  • CI=true pytest Tools/Solidity/test: 15 passed, exit 0. With the binary moved away: 15 skipped, exit 1 under CI=true, exit 0 without it.
  • lake test, three times: after the lakefile change JsonOutputTest is built; with nothing changed it is replayed; after appending a line to test_spec_basic.sol it is built again (the edit was reverted).
  • ci.yml parses.

Independent of #22 and #23; they touch different parts of ci.yml and README.md.

Three CI stages, and `lake test`, could pass without checking what they
are labelled with:

- REQ-PBT-008 validated the committed bench/results.csv, last written in
  May, so the check could only fail if someone edited that file. CI now
  runs bench/bench.sh (about 5 s; the old reason for skipping it, that
  b6_erc20 takes 10+ minutes, no longer holds) and validates the CSV it
  writes. The committed CSV is refreshed: its rows were stale (b3_token 9
  obligations instead of 12, b5_escrow "error" instead of 9/9 passed).
- REQ-PBT-004's pytest tests skip themselves when the binary or solc is
  missing, so the stage could pass with all 15 skipped. Under CI a
  skipped test now fails the run (Tools/Solidity/test/conftest.py).
- REQ-PBT-002 (pipeline determinism) had a driver but no CI step. CI now
  runs it on its default fixture and on test/examples/b3_token.sol.
- `lake test` replayed JsonOutputTest's cached result when only the
  fixtures it runs the binary on changed. lakefile.lean declares those
  fixtures as an input_dir of the test library, so a fixture change runs
  the tests again (checked: unchanged → replayed, fixture edited → built).

Also corrects run_pbt_determinism.sh's stale notes (the wrapper no longer
calls mktemp, and the pipeline has no Python or Ion stage), and README's
CI step list.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant